<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class HelloWorld extends Command
{

    /**
     * Execute the console command.
     *
     * @return int
     */
    protected $signature = 'hello:world {name?} {--U|upper}';

    protected $description = 'Say Hello to Someone';

    public function __construct()
    {
        parent::__construct();
    }

    public function handle()
    {
        $name = $this->argument('name') ?? 'World';
        if($this->option('upper')){
            $name = strtoupper($name);
        }
        $this->info("Hello {$name}!");
    }
}
